package com.songlanyun.modules.account.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.songlanyun.common.enums.MemberConstant;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.modules.account.entity.UserThirdIdentityEntity;
import com.songlanyun.modules.account.model.dto.UserThirdIdentityDTO;

import java.util.Map;

/**
 * 会员在第三方平台中的身份（如果在小程序中的openid）
 *
 * @author Mark
 * @email sunlightcs@gmail.com
 * @date 2020-11-04 10:36:59
 */
public interface UserThirdIdentityService extends IService<UserThirdIdentityEntity> {

    PageUtils queryPage(Map<String, Object> params);

    UserThirdIdentityEntity getByUserId(Long userId, boolean isThrow);

    String getOpenIdByUserId(Long userId, boolean isThrow);

    UserThirdIdentityEntity loadByThirdType(Long userId, MemberConstant.ThirdType thirdType, boolean tw);

    void binding(Long userId, UserThirdIdentityDTO dto);

    void unbind(Long userId, UserThirdIdentityDTO dto);
}

